//
//  SKYGlobalFunction.m
//  SkyonSDK
//
//  Created by 张二帅 on 2018/5/15.
//  Copyright © 2018年 Skyon. All rights reserved.
//

#import "SKYGlobalFunction.h"


NSString* sky_formatCapacitySize(unsigned long long size){
    if(size <= 0)
        return @"";
    int K = 1024;
    NSArray *sizeArray = [[NSArray alloc] initWithObjects:@"B", @"KB", @"MB", @"GB", @"TB", @"PB", @"EB", @"ZB", @"YB", nil];
    int index = floor(log(size) / log(K));
    return [NSString stringWithFormat:@"%0.2f%@",size/pow(K, index),[sizeArray objectAtIndex:index]];
}

@implementation SKYGlobalFunction

@end
